package com.qwz.learn;
/**
* @Description: 访问者模式客户端
* @Package com.qwz.learn.Client
* @author Qiuwuzhi
* @date 2019/12/27 16:53
* @version V1.0
*/
public class Client {

    public static void main(String[] args) {
        //构建ObjectStructure
        ObjectStructure objectStructure = new ObjectStructure();
        //创建需要加入的对象结构对象
        Element concreteElementA = new ConcreteElementA();
        Element concreteElementB = new ConcreteElementB();
        //把元素加入对象结构
        objectStructure.addElement(concreteElementA);
        objectStructure.addElement(concreteElementB);
        //创建访问者
        Visitor visitor1 = new ConcreteVisitor1();
        objectStructure.handleRequest(visitor1);
    }
}
